package com.kuangjia.student_ems.service;

import com.kuangjia.student_ems.dto.AttendanceDTO;
import com.kuangjia.student_ems.dto.AttendanceStatisticsDTO;
import com.kuangjia.student_ems.dto.request.AttendanceRequest;
import com.kuangjia.student_ems.dto.request.AttendanceLocationRequest;
import com.kuangjia.student_ems.entity.Attendance;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.time.LocalDate;
import java.util.List;
import java.util.Map;

public interface AttendanceService {
    
    AttendanceDTO clockIn(Long userId);
    
    AttendanceDTO clockOut(Long userId);
    
    // 带地理位置的签到签退方法
    AttendanceDTO clockInWithLocation(Long userId, AttendanceLocationRequest locationRequest);
    
    AttendanceDTO clockOutWithLocation(Long userId, AttendanceLocationRequest locationRequest);
    
    AttendanceDTO createAttendance(Long userId, AttendanceRequest request);
    
    AttendanceDTO updateAttendance(Long attendanceId, AttendanceRequest request);
    
    void deleteAttendance(Long attendanceId);
    
    AttendanceDTO getAttendanceById(Long attendanceId);
    
    AttendanceDTO getAttendanceByUserAndDate(Long userId, LocalDate date);
    
    List<AttendanceDTO> getAttendancesByUser(Long userId);
    
    List<AttendanceDTO> getAttendancesByUserAndDateRange(Long userId, LocalDate startDate, LocalDate endDate);
    
    List<AttendanceDTO> getAttendancesByDepartmentAndDateRange(Long departmentId, LocalDate startDate, LocalDate endDate);
    
    AttendanceStatisticsDTO getUserAttendanceStatistics(Long userId, LocalDate startDate, LocalDate endDate);
    
    List<AttendanceStatisticsDTO> getDepartmentAttendanceStatistics(Long departmentId, LocalDate startDate, LocalDate endDate);
    
    Map<Attendance.AttendanceStatus, Long> getAttendanceStatusCount(Long userId, LocalDate startDate, LocalDate endDate);
    
    List<AttendanceDTO> getAllAttendances();
    
    List<AttendanceDTO> searchAttendances(String keyword);
    
    IPage<AttendanceDTO> getAttendancePage(Page<Attendance> page, String keyword, Long userId, LocalDate startDate, LocalDate endDate, String sortField, String sortOrder);
} 